package day10.FileTest;

import java.io.File;
import java.io.IOException;
import java.util.Scanner;

public class Test2 {
    public static void main(String[] args) throws IOException {
        /*
        新建 /Users/hao/Desktop/abc/目录
        新建 abc/f1文件
        删除 f1 文件
        删除 abc 目录
         */
        System.out.print("按回车创建abc:");
        new Scanner(System.in).nextLine();
        File dir = new File("/Users/hao/Desktop/abc");
        dir.mkdirs();


        System.out.print("按回车创建f1.txt:");
        new Scanner(System.in).nextLine();
        File file = new File("/Users/hao/Desktop/abc/f1.txt");
        file.createNewFile();


        System.out.print("按回车删除f1.txt:");
        new Scanner(System.in).nextLine();
        file.delete();

        System.out.print("按回车删除abc:");
        new Scanner(System.in).nextLine();
        dir.delete();






    }
}
